$(function(){
	var row = $('#datagrid').datagrid('getSelected');
	var formId = row.id;
	var datagrid=$("#export-datagrid").datagrid();
	var selectRow=datagrid.datagrid("getSelected");
	var selectRowIndex=datagrid.datagrid('getRowIndex',selectRow);
	datagrid.datagrid("endEdit", selectRowIndex);
	//拿到全部数据
	var data=datagrid.datagrid("getData");
	if(data&&row){
		var newDatas=data.rows;
		var paramsdata=JSON.stringify(newDatas); 
		if (paramsdata){
			var params=paramsdata.substring(1,paramsdata.length-1);
			console.log(params);
			params=encodeURIComponent(params);
			$.post(contextpath+"/report/form/preview",{
				formId:formId,params:params
			},function(jsObj){
			console.log(jsObj);
			/*$.each(jsObj.paramList,function(i,data){
				newDatas.push({
					
				});
			});*/
		});
		}
	}
});